//
//  Animal.m
//  OC作业
//
//  Created by dllo on 15/12/1.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "Animal.h"

@implementation Animal

//- (void)setName:(NSString *)name{
//    _name = name;
//}
//- (NSString *)name{
//    return _name;
//}
//
//- (void)setSex:(NSString *)sex{
//    _sex = sex;
//}
//
//- (NSString *)sex{
//    return _sex;
//}
//
//- (void)setAge:(NSInteger)age{
//    _age = age;
//}
//
//- (NSInteger)age{
//    return _age;
//}

- (instancetype)initWithName:(NSString *)name
                         sex:(NSString *)sex
                         age:(NSInteger)age{
    
    self = [super init];
    if (self) {
        _name = name;
        _sex = sex;
        _age = age;
    }
    return self;
    
}

+ (instancetype)animalWithName:(NSString *)name
                           sex:(NSString *)sex
                           age:(NSInteger)age{
    Animal *ani = [[Animal alloc] initWithName:name sex:sex age:age];
    return ani;
    
}







@end
